package kizzo.game 
{	
	import flash.geom.Point;
	import flash.geom.Vector3D;
	import kizzo.geometry.TileCoord3D;
	/**
	 * ...
	 * @author KiZZo
	 */
	public class LinkModifier 
	{
		
		public function LinkModifier() 
		{
			
		}
		
		public function apply(v:TileCoord3D):TileCoord3D
		{
			return v;
		}		
		
		
		public static function MIRROR_Z(v:TileCoord3D):TileCoord3D
		{									
			return new TileCoord3D(v.x,v.y,-v.z);
		}	
		
		
		public static function MIRROR_X(v:TileCoord3D):TileCoord3D
		{									
			return new TileCoord3D(-v.x,v.y,v.z);
		}			
		
		
		public static function ROTATE_90_CW(v:TileCoord3D):TileCoord3D
		{			
			var v_rot:TileCoord3D;
			
			if (v.x == 1)			
				v_rot = new TileCoord3D(0, 0, 1, v.id);
			else if (v.x == -1)
				v_rot = new TileCoord3D(0, 0, -1, v.id);
			else if (v.z == 1)
				v_rot = new TileCoord3D(-1, 0, 0, v.id);
			else if (v.z == -1)
				v_rot = new TileCoord3D(1, 0, 0, v.id);
			else
				throw new Error("Cannot rotate. Invalid input direction vector.");
			
			return v_rot;
		}
		
		public static function BOOST(v:TileCoord3D):TileCoord3D
		{
			return v;
		}		
	}

}